#include("/common/layout/bootstrap_form_layout.html")
#@layout()

#define title()
#(jxrb.message(actionName,"deskmenu"))
#end

#define head()
<script language="javascript">
  seajs.use(["jquery", "jx_msgbox", "jx_check"], function ($, msgbox)
  {
    $("#b_submit").on("click", function ()
    {
      if (!jxCheck.check()) {
        return false;
      }
      msgbox.confirm({url: "#(controllerKey)#(action)/"},
      function ()
      {
        msgbox.close();
        clearForm()
      }, function ()
      {
        location.href = "#(controllerKey)";
      });
    });

    $("#b_return").on("click", function ()
    {
      returnInfo();
    });

    function returnInfo()
    {
      location.href = "#(controllerKey)" + $("#select").val();
    }
    var action = '#(action)';
    function clearForm()
    {
      if (action == "added") {
        $("#viewNum").val(parseInt($("#viewNum").val()) + 1);
        $("#menuName").val("");
        $("#menuLink").val("");
      }
    }

  });
</script>
#end

#define bodyExt()
class="gray-bg"
#end

#define form()
#include("info.html")
#end

#define formAfter()
<center>
  #jx_button({value:"action.save",class:"btn btn-primary"})&nbsp;&nbsp;&nbsp;&nbsp;
  #jx_button({value:"action.return",id:"b_return",class:"btn btn-danger"})
</center>
#end